package 二分;

/**
 * @author aodre , QQ : 480029069
 * @date 2023/8/6 10:23
 */
public class lc69x的平方跟 {


    public int solve(int x) {
        int l = 0, r = Integer.MAX_VALUE;

        while (l < r) {
            long mid = l + r + 1 >> 1, temp = mid * mid;
            if (temp > x) {
                mid = r - 1;
            } else {
                mid = l;
            }
        }
        return l;
    }
}
